package razor.blade;

import javafx.event.*;
import javafx.stage.*;
import javafx.scene.*;
import javafx.scene.control.*;

public class PopupMenu {

    private Popup extraInfoPopup;
    //private ContextMenu contextMenu;

    public PopupMenu() {
	extraInfoPopup = new Popup();
	//contextMenu = new ContextMenu();
	extraInfoPopup.getContent().add(new Plate().width(200).height(300).node());
	extraInfoPopup.setHideOnEscape(true);
	extraInfoPopup.setAutoHide(true);
	/*contextMenu.setOnHidden(new EventHandler<WindowEvent>() {

	    @Override public void handle(WindowEvent windowEvent) {
		extraInfoPopup.hide();
		System.out.println("hide");
	    }
	});
	contextMenu.setOnAction(new EventHandler<ActionEvent>() {

	    public void handle(ActionEvent e) {
		System.out.println("showing");
	    }
	});*/
    }

    public void show(Node n) {
	//System.out.println("popup");
	//contextMenu.show(n, 0, 0);
	extraInfoPopup.show(n, 0, 0);
    }
}
